home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / memdisk / memset.S < prev    next >
Encoding:
Text File  |  2003-04-14  |  430 b   |  31 lines

  1. # $Id: memset.S,v 1.1 2003/04/14 22:28:30 hpa Exp $
  2. #
  3. # memset.S
  4. #
  5. # Simple memset() implementation
  6. #
  7.  
  8.     .text
  9.     .globl memset
  10.     .type memset, @function
  11. memset:
  12.     cld
  13.     pushl %edi
  14.     pushl %esi
  15.     movl 12(%esp),%edi
  16.     movzbl 16(%esp),%eax
  17.     movl 20(%esp),%esi
  18.     imull $0x01010101,%eax
  19.     movl %esi,%ecx
  20.     shrl $2,%ecx
  21.     rep ; stosl
  22.     movl %esi,%ecx
  23.     andl $3,%ecx
  24.     rep ; stosb
  25.     movl 12(%esp),%eax
  26.     popl %esi
  27.     popl %edi
  28.     ret
  29.  
  30.     .size memcpy,.-memcpy
  31.